﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using BaseData;
using BaseData.Common;
using TaxEntity.User;

namespace TaxData.OaSys
{
    /// <summary>
    /// 集成系统邮件类
    /// </summary>
    public class EmailData
    { 
        /// <summary>
        /// 发送邮件
        /// </summary>
        public static bool Add(UserEntity model, string subject, string content, int mailto)
        {
            bool isSuccess = true;
            subject = subject.Replace("'", "''");
            content = content.Replace("'", "''");
            //必须要有发件人（92为需求方邮箱系统编号）
            string sql = string.Format("insert into getemailtable (senduserid,getuserid,emailtitle,emailcontent,iaddfile) "
                + "values(92, {0}, '{1}', '{2}', '')", mailto, subject, content);
            DataConfig.QueryNoRecords(BusinessType.DBemailSystem, sql);
            return isSuccess;
        }
    }
}
